<%--
    Document   : index
    Created on : Oct 11, 2011, 12:01:14 AM
    Author     : XuanTuan
--%>

<%@page import="sun.security.x509.X509CertImpl"%>
<%@page import="sun.security.x509.X500Name"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="model.CA_Service"%>
<%@page import="sun.security.x509.X509CertInfo"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>VeriSign Authentication Services - The leading Provider of SSL.
            Products include SSL, SSL Certificates, Extended Validation
            (EV SSL), VeriSign Trust Seal, Malware Scan & Code Signing.</title>
        <link href="styles.css" rel="stylesheet" type="text/css" media="screen" />
        <link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
    </head>
    <body>
        <div id="content">
            <div class="header_text">
                <div id="logo" >
                    <img src="images/verisignLogo.gif"/>
                </div>
            </div>
            <div id="back">
                <!-- header begins -->
                <div id="header">
                    <%@ include file="header.jsp" %>
                </div>
                <!-- header ends -->
                <!-- content begins -->
                <div id="main">
                    <div id="right">
                        <%
                                    String certPath = request.getParameter("certPath");
                                    X509CertImpl certInfo = new X509CertImpl(CA_Service.getCert(new FileInputStream(certPath)));
                                    X500Name subject = CA_Service.getSubject(new FileInputStream(certPath));
                        %>
                        <table cellspacing="10" style="font-size: 1.3em;">
                            <th colspan="2"><h3>Certificate information</h3></th>
                            <tr>
                                <td>Version: </td>
                                <td>3</td>
                            </tr>
                            <tr>
                                <td>Signature algorithm: </td>
                                <td>MD5 with RSA</td>
                            </tr>
                            <tr>
                                <td>Key size: </td>
                                <td>1024</td>
                            </tr>
                            <tr>
                                <td>Valid from: </td>
                                <td><%=certInfo.getNotBefore().toString()%></td>
                            </tr>
                            <tr>
                                <td>Valid to: </td>
                                <td><%=certInfo.getNotAfter().toString()%></td>
                            </tr>

                            <th colspan="2"><h3>Issuer Information</h3></th>
                            <tr>
                                <td>Common name: </td>
                                <td>VeriSign</td>
                            </tr>
                            <tr>
                                <td>Organizational unit: </td>
                                <td>JavaSoft</td>
                            </tr>
                            <tr>
                                <td>Organization: </td>
                                <td>Sun Microsystems</td>
                            </tr>
                            <tr>
                                <td>Country: </td>
                                <td>United States</td>
                            </tr>

                            <th colspan="2">
                                <h3>Your Information</h3>
                            </th>
                            <tr>
                                <td>Common name: </td>
                                <td><%=subject.getCommonName()%></td>
                            </tr>
                            <tr>
                                <td>Organizational unit: </td>
                                <td><%=subject.getOrganizationalUnit()%></td>
                            </tr>
                            <tr>
                                <td>Organization: </td>
                                <td><%=subject.getOrganization()%></td>
                            </tr>
                            <tr>
                                <td>Locality: </td>
                                <td><%=subject.getLocality()%></td>
                            </tr>
                            <tr>
                                <td>Country: </td>
                                <td><%=subject.getCountry()%></td>
                            </tr>
                        </table>
                        <br/>
                        <a href="./ManagerCert.jsp"><input type="button" value="<< Back"></a>
                    </div>

                    <div id="left">
                        <%@include file="leftPanel.jsp" %>
                    </div>


                    <!--content ends -->
                    <!--footer begins -->
                </div>


                <div id="footer">
                    <p>Copyright  2011.Design by Nguyen Xuan Tuan</p>
                </div>
                <div style="clear: both"></div>
            </div>

        </div>
        <!-- footer ends-->
    </body>
</html>
